package com.monster.token.entity;

import com.monster.token.common.TokenConstant;
import com.monster.token.utils.TokenUtils;

import java.util.HashMap;

/**
 * token信息
 *
 * @author kuang
 */
public class TokenUser extends HashMap<String, Object> {
    /**
     * 用户名称
     *
     * @param userName 用户名称
     */
    public void setUserName(String userName) {
        this.put(TokenConstant.USER_NAME, userName);
    }

    public String getUserName() {
        return TokenUtils.getObject(this.get(TokenConstant.USER_NAME));
    }

    /**
     * 用户id
     *
     * @param userId 用户id
     */
    public void setUserId(String userId) {
        this.put(TokenConstant.USER_ID, userId);
    }

    public String setUserId() {
        return TokenUtils.getObject(this.get(TokenConstant.USER_ID));
    }
}
